package cn.com.hbhgkj.model;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlRootElement;

import org.apache.commons.lang.StringUtils;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;

import cn.com.hbhgkj.Constants;
import cn.com.hbhgkj.util.IgnoreNameValuePair;

@Entity
@Table(name = "crs_copyright_application")
@Indexed
@XmlRootElement
public class CopyrightApplication extends BaseObject implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5725068523053379753L;

	@IgnoreNameValuePair
	private Long id;
	private String difmatReferMode;
	private String dlraddress;
	private String dlrcontactPerson;
	private String dlremail;
	private String dlrfax;
	private String dlrmobile;
	private String dlrname;
	private String dlrphone;
	private String dlrpostCode;
	private String editionNumber;
	// private String garden1;
	private String hardwareEnv;
	private String hasLetter1;
	// private String idNumber1;
	// private String idTypes1;
	private String isMutilDoc;
	private String kind;
	private String loginId;
	private String mutilDocType;
	// private String name1;
	private String origRegisterNumber;
	private String origSoftModifyDescription;
	// private String peopleType1;
	private String programLanguage;
	private String proveFile;
	// private String province1;
	private String publishStatus;
	private String rightObtainMode;
	private String rightScope;
	private String rightScopePart;
	private String shenqr;
	private String softForShort;
	private String softFullName;
	private String softFunctionAndSpecialty;
	private String softNumber;
	private String softwareEnv;
	private String sourceCodeCapacity;
	private String sqraddress;
	private String sqrcontactPerson;
	private String sqremail;
	private String sqrfax;
	private String sqrmobile;
	private String sqrname;
	private String sqrphone;
	private String sqrpostCode;
	@IgnoreNameValuePair
	private Integer state;
	private String agentDesc;
	private String appearAreaCity;
	private String appearAreaCountry;
	private String appearDate;
	private String applyType;
	private String belongType0;
	// private String busType1;
	// private String city1;
	private String completeDate;
	private String dailr;
	private String developCircs;
	private String developMode;
	private String difmatKeepPages;

	private String developCircsExplain;
	private String origSoftRegCircs;
	private String isSoftChanged;
	private String isSoftReg;
	
	@IgnoreNameValuePair
	private boolean developCircsExplainChecked;
	@IgnoreNameValuePair
	private boolean origSoftRegCircsChecked;
	@IgnoreNameValuePair
	private boolean softChangedChecked;
	@IgnoreNameValuePair
	private boolean softRegChecked;
	
	public void setDevelopCircsExplain(String developCircsExplain) {
		this.developCircsExplain = developCircsExplain;
	}

	public void setOrigSoftRegCircs(String origSoftRegCircs) {
		this.origSoftRegCircs = origSoftRegCircs;
	}

	public void setIsSoftChanged(String isSoftChanged) {
		this.isSoftChanged = isSoftChanged;
	}

	public void setIsSoftReg(String isSoftReg) {
		this.isSoftReg = isSoftReg;
	}

	public boolean isDevelopCircsExplainChecked() {
		return developCircsExplainChecked;
	}

	public void setDevelopCircsExplainChecked(boolean developCircsExplainChecked) {
		this.developCircsExplainChecked = developCircsExplainChecked;
	}
	
	
	public boolean isOrigSoftRegCircsChecked() {
		return origSoftRegCircsChecked;
	}

	public void setOrigSoftRegCircsChecked(boolean origSoftRegCircsChecked) {
		this.origSoftRegCircsChecked = origSoftRegCircsChecked;
	}

	public boolean isSoftChangedChecked() {
		return softChangedChecked;
	}

	public void setSoftChangedChecked(boolean softChangedChecked) {
		this.softChangedChecked = softChangedChecked;
	}
	
	public boolean isSoftRegChecked() {
		return softRegChecked;
	}

	public void setSoftRegChecked(boolean softRegChecked) {
		this.softRegChecked = softRegChecked;
	}

	// private String country1;
	@IgnoreNameValuePair
	private Date applyTime;
	@IgnoreNameValuePair
	private Date updateTime;
	@IgnoreNameValuePair
	private User applicant;
	@IgnoreNameValuePair
	private User reviewer;

	public String getDevelopCircsExplain() {
		if(isDevelopCircsExplainChecked())
			return "0";
		return "";
	}

	public String getOrigSoftRegCircs() {
		if(isOrigSoftRegCircsChecked())
			return "0";
		return "";
	}

	@Column(name = "isSoftChanged", length = 50)
	@Field
	public String getIsSoftChanged() {
		if(isSoftChangedChecked())
			return "0";
		return "";
	}

	@Column(name = "isSoftReg", length = 50)
	@Field
	public String getIsSoftReg() {
		if(isSoftRegChecked())
			return "0";
		return "";
	}

	private String inheritanceMode;
	
	private String regNumber;
	
	private String changeNumber;
	private String difmatReferModeExcep;
	private String difmatReferPages;

	private String peopleTypes;
	private String countries;
	private String names;
	private String provinces;
	private String citys;
	private String idTypes;
	private String idNumbers;
	private String gardens;
	private String busTypes;

	@Transient
	public Copyrighter[] getCopyrighters() {
		Copyrighter[] copyrighters = null;
		Copyrighter c = null;
		if (StringUtils.isEmpty(names)) {
			copyrighters = new Copyrighter[1];
			c = new Copyrighter();
			copyrighters[0] = c;
			return copyrighters;
		}

		String[] peopleTypes = this.peopleTypes.split("&");

		String[] countries = this.countries.split("&");
		String[] names = this.names.split("&");
		String[] provinces = this.provinces.split("&");
		String[] citys = this.citys.split("&");
		String[] idTypes = this.idTypes.split("&");
		String[] idNumbers = this.idNumbers.split("&");
		/* String[] gardens = this.gardens.split("&"); */
		String[] busTypes = this.busTypes.split("&");
		copyrighters = new Copyrighter[names.length];

		for (int i = 0; i < names.length; i++) {
			c = new Copyrighter();
			c.setName(fetchString(names, i));
			c.setPeopleType(fetchString(peopleTypes, i));
			c.setCountry(fetchString(countries, i));
			c.setProvince(fetchString(provinces, i));
			c.setCity(fetchString(citys, i));
			c.setIdType(fetchString(idTypes, i));
			c.setIdNumber(fetchString(idNumbers, i));
			// c.setGarden(fetchString(gardens, i));
			c.setBusType(fetchString(busTypes, i));
			copyrighters[i] = c;
		}

		return copyrighters;
	}

	@Transient
	private String fetchString(String[] arr, int index) {
		String result = "";
		try {
			result = arr[index];
		} catch (Exception e) {
			result = "";
		}

		return result;
	}

	@Column(name = "difmatReferPages", length = 200)
	@Field
	public String getDifmatReferPages() {
		if (StringUtils.isEmpty(difmatReferPages)) {
			return "0";
		}
		return difmatReferPages;
	}

	public void setDifmatReferPages(String difmatReferPages) {
		this.difmatReferPages = difmatReferPages;
	}

	@Column(name = "inheritanceMode", length = 50)
	@Field
	public String getInheritanceMode() {
		return inheritanceMode;
	}

	public void setInheritanceMode(String inheritanceMode) {
		this.inheritanceMode = inheritanceMode;
	}


	@Column(name = "regNumber", length = 50)
	@Field
	public String getRegNumber() {
		return regNumber;
	}

	public void setRegNumber(String regNumber) {
		this.regNumber = regNumber;
	}

	

	@Column(name = "changeNumber", length = 50)
	@Field
	public String getChangeNumber() {
		return changeNumber;
	}

	public void setChangeNumber(String changeNumber) {
		this.changeNumber = changeNumber;
	}

	@Column(name = "difmatReferModeExcep", length = 50)
	@Field
	public String getDifmatReferModeExcep() {
		return difmatReferModeExcep;
	}

	public void setDifmatReferModeExcep(String difmatReferModeExcep) {
		this.difmatReferModeExcep = difmatReferModeExcep;
	}

	@ManyToOne
	@JoinColumn(name = "applicant_id", nullable = true, insertable = true, updatable = true)
	public User getApplicant() {
		return applicant;
	}

	public void setApplicant(User applicant) {
		this.applicant = applicant;
	}

	@ManyToOne
	@JoinColumn(name = "reviewer_id", nullable = true, insertable = true, updatable = true)
	public User getReviewer() {
		return reviewer;
	}

	public void setReviewer(User reviewer) {
		this.reviewer = reviewer;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@DocumentId
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "difmatReferMode", length = 50)
	@Field
	public String getDifmatReferMode() {
		if (StringUtils.isEmpty(difmatReferMode))
			return "1";
		return this.difmatReferMode;
	}

	public void setDifmatReferMode(String difmatReferMode) {
		this.difmatReferMode = difmatReferMode;
	}

	@Column(name = "dlraddress", length = 50)
	@Field
	public String getDlraddress() {
		return Constants.AGENT_ADDRESS;
	}

	public void setDlraddress(String dlraddress) {
		this.dlraddress = dlraddress;
	}

	@Column(name = "peopleTypes", length = 1000)
	@Field
	public String getPeopleTypes() {
		return peopleTypes;
	}

	public void setPeopleTypes(String peopleTypes) {
		this.peopleTypes = peopleTypes;
	}

	@Column(name = "countries", length = 1000)
	@Field
	public String getCountries() {
		return countries;
	}

	public void setCountries(String countries) {
		this.countries = countries;
	}

	@Column(name = "names", length = 1000)
	@Field
	public String getNames() {
		return names;
	}

	public void setNames(String names) {
		this.names = names;
	}

	@Column(name = "provinces", length = 1000)
	@Field
	public String getProvinces() {
		return provinces;
	}

	public void setProvinces(String provinces) {
		this.provinces = provinces;
	}

	@Column(name = "citys", length = 1000)
	@Field
	public String getCitys() {
		return citys;
	}

	public void setCitys(String citys) {
		this.citys = citys;
	}

	@Column(name = "idTypes", length = 200)
	@Field
	public String getIdTypes() {
		return idTypes;
	}

	public void setIdTypes(String idTypes) {
		this.idTypes = idTypes;
	}

	@Column(name = "idNumbers", length = 1000)
	@Field
	public String getIdNumbers() {
		return idNumbers;
	}

	public void setIdNumbers(String idNumbers) {
		this.idNumbers = idNumbers;
	}

	@Column(name = "gardens", length = 1000)
	@Field
	public String getGardens() {
		return gardens;
	}

	public void setGardens(String gardens) {
		this.gardens = gardens;
	}

	@Column(name = "busTypes", length = 1000)
	@Field
	public String getBusTypes() {
		return busTypes;
	}

	public void setBusTypes(String busTypes) {
		this.busTypes = busTypes;
	}

	@Column(name = "dlrcontactPerson", length = 50)
	@Field
	public String getDlrcontactPerson() {
		return Constants.AGENT_CONTACT;
	}

	public void setDlrcontactPerson(String dlrcontactPerson) {
		this.dlrcontactPerson = dlrcontactPerson;
	}

	@Column(name = "dlremail", length = 50)
	@Field
	public String getDlremail() {
		return Constants.AGENT_EMAIL;
	}

	public void setDlremail(String dlremail) {
		this.dlremail = dlremail;
	}

	@Column(name = "dlrfax", length = 50)
	@Field
	public String getDlrfax() {
		return Constants.AGENT_FAX;
	}

	public void setDlrfax(String dlrfax) {
		this.dlrfax = dlrfax;
	}

	@Column(name = "dlrmobile", length = 50)
	@Field
	public String getDlrmobile() {
		return Constants.AGENT_MOBILE;
	}

	public void setDlrmobile(String dlrmobile) {
		this.dlrmobile = dlrmobile;
	}

	@Column(name = "dlrname", length = 50)
	@Field
	public String getDlrname() {
		return Constants.AGENT_NAME;
	}

	public void setDlrname(String dlrname) {
		this.dlrname = dlrname;
	}

	@Column(name = "dlrphone", length = 50)
	@Field
	public String getDlrphone() {
		return Constants.AGENT_PHONE;
	}

	public void setDlrphone(String dlrphone) {
		this.dlrphone = dlrphone;
	}

	@Column(name = "dlrpostCode", length = 50)
	@Field
	public String getDlrpostCode() {
		return Constants.AGENT_POSTCODE;
	}

	public void setDlrpostCode(String dlrpostCode) {
		this.dlrpostCode = dlrpostCode;
	}

	@Column(name = "editionNumber", length = 80)
	@Field
	public String getEditionNumber() {
		return this.editionNumber;
	}

	public void setEditionNumber(String editionNumber) {
		this.editionNumber = editionNumber;
	}

	/*
	 * @Column(name="garden1", length=50)
	 * 
	 * @Field public String getGarden1() { return this.garden1; }
	 * 
	 * public void setGarden1(String garden1) { this.garden1 = garden1; }
	 */

	@Column(name = "hardwareEnv", length = 600)
	@Field
	public String getHardwareEnv() {
		return this.hardwareEnv;
	}

	public void setHardwareEnv(String hardwareEnv) {
		this.hardwareEnv = hardwareEnv;
	}

	@Column(name = "hasLetter1", length = 50)
	@Field
	public String getHasLetter1() {
		return this.hasLetter1;
	}

	public void setHasLetter1(String hasLetter1) {
		this.hasLetter1 = hasLetter1;
	}

	/*
	 * @Column(name="idNumber1", length=50)
	 * 
	 * @Field public String getIdNumber1() { return this.idNumber1; }
	 * 
	 * public void setIdNumber1(String idNumber1) { this.idNumber1 = idNumber1;
	 * }
	 * 
	 * @Column(name="idTypes1", length=50)
	 * 
	 * @Field public String getIdTypes1() { return this.idTypes1; }
	 * 
	 * public void setIdTypes1(String idTypes1) { this.idTypes1 = idTypes1; }
	 */
	@Column(name = "isMutilDoc", length = 50)
	@Field
	public String getIsMutilDoc() {
		if (StringUtils.isEmpty(isMutilDoc))
			return "oneDoc";
		return this.isMutilDoc;
	}

	public void setIsMutilDoc(String isMutilDoc) {
		this.isMutilDoc = isMutilDoc;
	}

	@Column(name = "kind", length = 50)
	@Field
	public String getKind() {
		return "R11";
	}

	public void setKind(String kind) {
		this.kind = kind;
	}

	@Column(name = "loginId", length = 50)
	@Field
	public String getLoginId() {
		return this.loginId;
	}

	public void setLoginId(String loginId) {
		this.loginId = loginId;
	}

	@Column(name = "mutilDocType", length = 50)
	@Field
	public String getMutilDocType() {
		if (StringUtils.isEmpty(mutilDocType)) {
			return "0";
		}
		return this.mutilDocType;
	}

	public void setMutilDocType(String mutilDocType) {
		this.mutilDocType = mutilDocType;
	}

	@Transient
	public String getName1() {
		if (StringUtils.isEmpty(names))
			return "";
		return names.split("&")[0];
	}

	@Column(name = "origRegisterNumber", length = 50)
	@Field
	public String getOrigRegisterNumber() {
		return this.origRegisterNumber;
	}

	public void setOrigRegisterNumber(String origRegisterNumber) {
		this.origRegisterNumber = origRegisterNumber;
	}

	@Column(name = "origSoftModifyDescription", length = 50)
	@Field
	public String getOrigSoftModifyDescription() {
		return this.origSoftModifyDescription;
	}

	public void setOrigSoftModifyDescription(String origSoftModifyDescription) {
		this.origSoftModifyDescription = origSoftModifyDescription;
	}

	/*
	 * @Column(name="peopleType1", length=50)
	 * 
	 * @Field public String getPeopleType1() { return this.peopleType1; }
	 * 
	 * public void setPeopleType1(String peopleType1) { this.peopleType1 =
	 * peopleType1; }
	 */
	@Column(name = "programLanguage", length = 200)
	@Field
	public String getProgramLanguage() {
		return this.programLanguage;
	}

	public void setProgramLanguage(String programLanguage) {
		this.programLanguage = programLanguage;
	}

	@Column(name = "proveFile", length = 50)
	@Field
	public String getProveFile() {
		return this.proveFile;
	}

	public void setProveFile(String proveFile) {
		this.proveFile = proveFile;
	}

	/*
	 * @Column(name="province1", length=50)
	 * 
	 * @Field public String getProvince1() { return this.province1; }
	 * 
	 * public void setProvince1(String province1) { this.province1 = province1;
	 * }
	 */
	@Column(name = "publishStatus", length = 50)
	@Field
	public String getPublishStatus() {
		if (StringUtils.isEmpty(publishStatus))
			return "1";
		return this.publishStatus;
	}

	public void setPublishStatus(String publishStatus) {
		this.publishStatus = publishStatus;
	}

	@Column(name = "rightObtainMode", length = 50)
	@Field
	public String getRightObtainMode() {
		if (StringUtils.isEmpty(rightObtainMode))
			return "1";
		return this.rightObtainMode;
	}

	public void setRightObtainMode(String rightObtainMode) {
		this.rightObtainMode = rightObtainMode;
	}

	@Column(name = "rightScope", length = 50)
	@Field
	public String getRightScope() {
		if (StringUtils.isEmpty(rightScope))
			return "1";
		return this.rightScope;
	}

	public void setRightScope(String rightScope) {
		this.rightScope = rightScope;
	}

	@Column(name = "rightScopePart", length = 50)
	@Field
	public String getRightScopePart() {
		return this.rightScopePart;
	}

	public void setRightScopePart(String rightScopePart) {
		this.rightScopePart = rightScopePart;
	}

	@Column(name = "shenqr", length = 50)
	@Field
	public String getShenqr() {
		return "申请人";
	}

	public void setShenqr(String shenqr) {
		this.shenqr = shenqr;
	}

	@Column(name = "softForShort", length = 200)
	@Field
	public String getSoftForShort() {
		return this.softForShort;
	}

	public void setSoftForShort(String softForShort) {
		this.softForShort = softForShort;
	}

	@Column(name = "softFullName", length = 400)
	@Field
	public String getSoftFullName() {
		return this.softFullName;
	}

	public void setSoftFullName(String softFullName) {
		this.softFullName = softFullName;
	}

	@Column(name = "softFunctionAndSpecialty", length = 1000)
	@Field
	public String getSoftFunctionAndSpecialty() {
		return this.softFunctionAndSpecialty;
	}

	public void setSoftFunctionAndSpecialty(String softFunctionAndSpecialty) {
		this.softFunctionAndSpecialty = softFunctionAndSpecialty;
	}

	@Column(name = "softNumber", length = 50)
	@Field
	public String getSoftNumber() {
		return this.softNumber;
	}

	public void setSoftNumber(String softNumber) {
		this.softNumber = softNumber;
	}

	@Column(name = "softwareEnv", length = 600)
	@Field
	public String getSoftwareEnv() {
		return this.softwareEnv;
	}

	public void setSoftwareEnv(String softwareEnv) {
		this.softwareEnv = softwareEnv;
	}

	@Column(name = "sourceCodeCapacity", length = 100)
	@Field
	public String getSourceCodeCapacity() {
		return this.sourceCodeCapacity;
	}

	public void setSourceCodeCapacity(String sourceCodeCapacity) {
		this.sourceCodeCapacity = sourceCodeCapacity;
	}

	@Column(name = "sqraddress", length = 200)
	@Field
	public String getSqraddress() {
		return this.sqraddress;
	}

	public void setSqraddress(String sqraddress) {
		this.sqraddress = sqraddress;
	}

	@Column(name = "sqrcontactPerson", length = 200)
	@Field
	public String getSqrcontactPerson() {
		return this.sqrcontactPerson;
	}

	public void setSqrcontactPerson(String sqrcontactPerson) {
		this.sqrcontactPerson = sqrcontactPerson;
	}

	@Column(name = "sqremail", length = 200)
	@Field
	public String getSqremail() {
		return this.sqremail;
	}

	public void setSqremail(String sqremail) {
		this.sqremail = sqremail;
	}

	@Column(name = "sqrfax", length = 100)
	@Field
	public String getSqrfax() {
		return this.sqrfax;
	}

	public void setSqrfax(String sqrfax) {
		this.sqrfax = sqrfax;
	}

	@Column(name = "sqrmobile", length = 100)
	@Field
	public String getSqrmobile() {
		return this.sqrmobile;
	}

	public void setSqrmobile(String sqrmobile) {
		this.sqrmobile = sqrmobile;
	}

	@Column(name = "sqrname", length = 500)
	@Field
	public String getSqrname() {
		return this.sqrname;
	}

	public void setSqrname(String sqrname) {
		this.sqrname = sqrname;
	}

	@Column(name = "sqrphone", length = 100)
	@Field
	public String getSqrphone() {
		return this.sqrphone;
	}

	public void setSqrphone(String sqrphone) {
		this.sqrphone = sqrphone;
	}

	@Column(name = "sqrpostCode", length = 100)
	@Field
	public String getSqrpostCode() {
		return this.sqrpostCode;
	}

	public void setSqrpostCode(String sqrpostCode) {
		this.sqrpostCode = sqrpostCode;
	}

	@Column(name = "state")
	@Field
	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	@Column(name = "agentDesc", length = 50)
	@Field
	public String getAgentDesc() {
		return Constants.AGENT_DESC;
	}

	public void setAgentDesc(String agentDesc) {
		this.agentDesc = agentDesc;
	}

	@Column(name = "appearAreaCity", length = 80)
	@Field
	public String getAppearAreaCity() {
		return this.appearAreaCity;
	}

	public void setAppearAreaCity(String appearAreaCity) {
		this.appearAreaCity = appearAreaCity;
	}

	@Column(name = "appearAreaCountry", length = 80)
	@Field
	public String getAppearAreaCountry() {
		if (StringUtils.isEmpty(appearAreaCountry))
			return "中国";
		return this.appearAreaCountry;
	}

	public void setAppearAreaCountry(String appearAreaCountry) {
		this.appearAreaCountry = appearAreaCountry;
	}

	@Column(name = "appearDate", length = 50)
	@Field
	public String getAppearDate() {
		return this.appearDate;
	}

	public void setAppearDate(String appearDate) {
		this.appearDate = appearDate;
	}

	@Column(name = "applyType", length = 50)
	@Field
	public String getApplyType() {
		return "代理人";
	}

	public void setApplyType(String applyType) {
		this.applyType = applyType;
	}

	@Column(name = "belongType0", length = 50)
	@Field
	public String getBelongType0() {
		return "著作权人";
	}

	public void setBelongType0(String belongType0) {
		this.belongType0 = belongType0;
	}

	/*
	 * @Column(name="busType1", length=50)
	 * 
	 * @Field public String getBusType1() { return this.busType1; }
	 * 
	 * public void setBusType1(String busType1) { this.busType1 = busType1; }
	 * 
	 * @Column(name="city1", length=50)
	 * 
	 * @Field public String getCity1() { return this.city1; }
	 * 
	 * public void setCity1(String city1) { this.city1 = city1; }
	 */

	@Column(name = "completeDate", length = 50)
	@Field
	public String getCompleteDate() {
		return this.completeDate;
	}

	public void setCompleteDate(String completeDate) {
		this.completeDate = completeDate;
	}

	@Column(name = "dailr", length = 50)
	@Field
	public String getDailr() {
		return "代理人";
	}

	public void setDailr(String dailr) {
		this.dailr = dailr;
	}

	@Column(name = "developCircs", length = 50)
	@Field
	public String getDevelopCircs() {

		if (StringUtils.isEmpty(developCircs)) {
			return "1";
		}
		return this.developCircs;
	}

	public void setDevelopCircs(String developCircs) {
		this.developCircs = developCircs;
	}

	@Column(name = "developMode", length = 50)
	@Field
	public String getDevelopMode() {
		if (StringUtils.isEmpty(developMode)) {
			return "1";
		}
		return this.developMode;
	}

	public void setDevelopMode(String developMode) {
		this.developMode = developMode;
	}

	@Column(name = "difmatKeepPages", length = 50)
	@Field
	public String getDifmatKeepPages() {
		return this.difmatKeepPages;
	}

	public void setDifmatKeepPages(String difmatKeepPages) {
		this.difmatKeepPages = difmatKeepPages;
	}

	/*
	 * @Column(name="country1", length=50)
	 * 
	 * @Field public String getCountry1() { for(Locale each :
	 * Locale.getAvailableLocales()){
	 * if(each.getDisplayCountry().equals(this.country1)){ return
	 * each.getCountry(); } } return ""; }
	 * 
	 * public void setCountry1(String country1) { Locale l = new
	 * Locale("",country1); this.country1 = l.getDisplayCountry(); }
	 */

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "applyTime", length = 19)
	@Field
	public Date getApplyTime() {
		return this.applyTime;
	}

	public void setApplyTime(Date applyTime) {
		this.applyTime = applyTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "updateTime", length = 19)
	@Field
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		CopyrightApplication pojo = (CopyrightApplication) o;

		if (difmatReferMode != null ? !difmatReferMode
				.equals(pojo.difmatReferMode) : pojo.difmatReferMode != null)
			return false;
		if (dlraddress != null ? !dlraddress.equals(pojo.dlraddress)
				: pojo.dlraddress != null)
			return false;
		if (dlrcontactPerson != null ? !dlrcontactPerson
				.equals(pojo.dlrcontactPerson) : pojo.dlrcontactPerson != null)
			return false;
		if (dlremail != null ? !dlremail.equals(pojo.dlremail)
				: pojo.dlremail != null)
			return false;
		if (dlrfax != null ? !dlrfax.equals(pojo.dlrfax) : pojo.dlrfax != null)
			return false;
		if (dlrmobile != null ? !dlrmobile.equals(pojo.dlrmobile)
				: pojo.dlrmobile != null)
			return false;
		if (dlrname != null ? !dlrname.equals(pojo.dlrname)
				: pojo.dlrname != null)
			return false;
		if (dlrphone != null ? !dlrphone.equals(pojo.dlrphone)
				: pojo.dlrphone != null)
			return false;
		if (dlrpostCode != null ? !dlrpostCode.equals(pojo.dlrpostCode)
				: pojo.dlrpostCode != null)
			return false;
		if (editionNumber != null ? !editionNumber.equals(pojo.editionNumber)
				: pojo.editionNumber != null)
			return false;
		// if (garden1 != null ? !garden1.equals(pojo.garden1) : pojo.garden1 !=
		// null) return false;
		if (hardwareEnv != null ? !hardwareEnv.equals(pojo.hardwareEnv)
				: pojo.hardwareEnv != null)
			return false;
		if (hasLetter1 != null ? !hasLetter1.equals(pojo.hasLetter1)
				: pojo.hasLetter1 != null)
			return false;
		// if (idNumber1 != null ? !idNumber1.equals(pojo.idNumber1) :
		// pojo.idNumber1 != null) return false;
		// if (idTypes1 != null ? !idTypes1.equals(pojo.idTypes1) :
		// pojo.idTypes1 != null) return false;
		if (isMutilDoc != null ? !isMutilDoc.equals(pojo.isMutilDoc)
				: pojo.isMutilDoc != null)
			return false;
		if (kind != null ? !kind.equals(pojo.kind) : pojo.kind != null)
			return false;
		if (loginId != null ? !loginId.equals(pojo.loginId)
				: pojo.loginId != null)
			return false;
		if (mutilDocType != null ? !mutilDocType.equals(pojo.mutilDocType)
				: pojo.mutilDocType != null)
			return false;
		// if (name1 != null ? !name1.equals(pojo.name1) : pojo.name1 != null)
		// return false;
		if (origRegisterNumber != null ? !origRegisterNumber
				.equals(pojo.origRegisterNumber)
				: pojo.origRegisterNumber != null)
			return false;
		if (origSoftModifyDescription != null ? !origSoftModifyDescription
				.equals(pojo.origSoftModifyDescription)
				: pojo.origSoftModifyDescription != null)
			return false;
		// if (peopleType1 != null ? !peopleType1.equals(pojo.peopleType1) :
		// pojo.peopleType1 != null) return false;
		if (programLanguage != null ? !programLanguage
				.equals(pojo.programLanguage) : pojo.programLanguage != null)
			return false;
		if (proveFile != null ? !proveFile.equals(pojo.proveFile)
				: pojo.proveFile != null)
			return false;
		// if (province1 != null ? !province1.equals(pojo.province1) :
		// pojo.province1 != null) return false;
		if (publishStatus != null ? !publishStatus.equals(pojo.publishStatus)
				: pojo.publishStatus != null)
			return false;
		if (rightObtainMode != null ? !rightObtainMode
				.equals(pojo.rightObtainMode) : pojo.rightObtainMode != null)
			return false;
		if (rightScope != null ? !rightScope.equals(pojo.rightScope)
				: pojo.rightScope != null)
			return false;
		if (rightScopePart != null ? !rightScopePart
				.equals(pojo.rightScopePart) : pojo.rightScopePart != null)
			return false;
		if (shenqr != null ? !shenqr.equals(pojo.shenqr) : pojo.shenqr != null)
			return false;
		if (softForShort != null ? !softForShort.equals(pojo.softForShort)
				: pojo.softForShort != null)
			return false;
		if (softFullName != null ? !softFullName.equals(pojo.softFullName)
				: pojo.softFullName != null)
			return false;
		if (softFunctionAndSpecialty != null ? !softFunctionAndSpecialty
				.equals(pojo.softFunctionAndSpecialty)
				: pojo.softFunctionAndSpecialty != null)
			return false;
		if (softNumber != null ? !softNumber.equals(pojo.softNumber)
				: pojo.softNumber != null)
			return false;
		if (softwareEnv != null ? !softwareEnv.equals(pojo.softwareEnv)
				: pojo.softwareEnv != null)
			return false;
		if (sourceCodeCapacity != null ? !sourceCodeCapacity
				.equals(pojo.sourceCodeCapacity)
				: pojo.sourceCodeCapacity != null)
			return false;
		if (sqraddress != null ? !sqraddress.equals(pojo.sqraddress)
				: pojo.sqraddress != null)
			return false;
		if (sqrcontactPerson != null ? !sqrcontactPerson
				.equals(pojo.sqrcontactPerson) : pojo.sqrcontactPerson != null)
			return false;
		if (sqremail != null ? !sqremail.equals(pojo.sqremail)
				: pojo.sqremail != null)
			return false;
		if (sqrfax != null ? !sqrfax.equals(pojo.sqrfax) : pojo.sqrfax != null)
			return false;
		if (sqrmobile != null ? !sqrmobile.equals(pojo.sqrmobile)
				: pojo.sqrmobile != null)
			return false;
		if (sqrname != null ? !sqrname.equals(pojo.sqrname)
				: pojo.sqrname != null)
			return false;
		if (sqrphone != null ? !sqrphone.equals(pojo.sqrphone)
				: pojo.sqrphone != null)
			return false;
		if (sqrpostCode != null ? !sqrpostCode.equals(pojo.sqrpostCode)
				: pojo.sqrpostCode != null)
			return false;
		if (state != null ? !state.equals(pojo.state) : pojo.state != null)
			return false;
		if (agentDesc != null ? !agentDesc.equals(pojo.agentDesc)
				: pojo.agentDesc != null)
			return false;
		if (appearAreaCity != null ? !appearAreaCity
				.equals(pojo.appearAreaCity) : pojo.appearAreaCity != null)
			return false;
		if (appearAreaCountry != null ? !appearAreaCountry
				.equals(pojo.appearAreaCountry)
				: pojo.appearAreaCountry != null)
			return false;
		if (appearDate != null ? !appearDate.equals(pojo.appearDate)
				: pojo.appearDate != null)
			return false;
		if (applyType != null ? !applyType.equals(pojo.applyType)
				: pojo.applyType != null)
			return false;
		if (belongType0 != null ? !belongType0.equals(pojo.belongType0)
				: pojo.belongType0 != null)
			return false;
		// if (busType1 != null ? !busType1.equals(pojo.busType1) :
		// pojo.busType1 != null) return false;
		// if (city1 != null ? !city1.equals(pojo.city1) : pojo.city1 != null)
		// return false;
		if (completeDate != null ? !completeDate.equals(pojo.completeDate)
				: pojo.completeDate != null)
			return false;
		if (dailr != null ? !dailr.equals(pojo.dailr) : pojo.dailr != null)
			return false;
		if (developCircs != null ? !developCircs.equals(pojo.developCircs)
				: pojo.developCircs != null)
			return false;
		if (developMode != null ? !developMode.equals(pojo.developMode)
				: pojo.developMode != null)
			return false;
		if (difmatKeepPages != null ? !difmatKeepPages
				.equals(pojo.difmatKeepPages) : pojo.difmatKeepPages != null)
			return false;
		// if (country1 != null ? !country1.equals(pojo.country1) :
		// pojo.country1 != null) return false;
		if (applyTime != null ? !applyTime.equals(pojo.applyTime)
				: pojo.applyTime != null)
			return false;
		if (updateTime != null ? !updateTime.equals(pojo.updateTime)
				: pojo.updateTime != null)
			return false;

		return true;
	}

	public int hashCode() {
		int result = 0;
		result = (difmatReferMode != null ? difmatReferMode.hashCode() : 0);
		result = 31 * result + (dlraddress != null ? dlraddress.hashCode() : 0);
		result = 31 * result
				+ (dlrcontactPerson != null ? dlrcontactPerson.hashCode() : 0);
		result = 31 * result + (dlremail != null ? dlremail.hashCode() : 0);
		result = 31 * result + (dlrfax != null ? dlrfax.hashCode() : 0);
		result = 31 * result + (dlrmobile != null ? dlrmobile.hashCode() : 0);
		result = 31 * result + (dlrname != null ? dlrname.hashCode() : 0);
		result = 31 * result + (dlrphone != null ? dlrphone.hashCode() : 0);
		result = 31 * result
				+ (dlrpostCode != null ? dlrpostCode.hashCode() : 0);
		result = 31 * result
				+ (editionNumber != null ? editionNumber.hashCode() : 0);
		// result = 31 * result + (garden1 != null ? garden1.hashCode() : 0);
		result = 31 * result
				+ (hardwareEnv != null ? hardwareEnv.hashCode() : 0);
		result = 31 * result + (hasLetter1 != null ? hasLetter1.hashCode() : 0);
		// result = 31 * result + (idNumber1 != null ? idNumber1.hashCode() :
		// 0);
		// result = 31 * result + (idTypes1 != null ? idTypes1.hashCode() : 0);
		result = 31 * result + (isMutilDoc != null ? isMutilDoc.hashCode() : 0);
		result = 31 * result + (kind != null ? kind.hashCode() : 0);
		result = 31 * result + (loginId != null ? loginId.hashCode() : 0);
		result = 31 * result
				+ (mutilDocType != null ? mutilDocType.hashCode() : 0);
		// result = 31 * result + (name1 != null ? name1.hashCode() : 0);
		result = 31
				* result
				+ (origRegisterNumber != null ? origRegisterNumber.hashCode()
						: 0);
		result = 31
				* result
				+ (origSoftModifyDescription != null ? origSoftModifyDescription
						.hashCode() : 0);
		// result = 31 * result + (peopleType1 != null ? peopleType1.hashCode()
		// : 0);
		result = 31 * result
				+ (programLanguage != null ? programLanguage.hashCode() : 0);
		result = 31 * result + (proveFile != null ? proveFile.hashCode() : 0);
		// result = 31 * result + (province1 != null ? province1.hashCode() :
		// 0);
		result = 31 * result
				+ (publishStatus != null ? publishStatus.hashCode() : 0);
		result = 31 * result
				+ (rightObtainMode != null ? rightObtainMode.hashCode() : 0);
		result = 31 * result + (rightScope != null ? rightScope.hashCode() : 0);
		result = 31 * result
				+ (rightScopePart != null ? rightScopePart.hashCode() : 0);
		result = 31 * result + (shenqr != null ? shenqr.hashCode() : 0);
		result = 31 * result
				+ (softForShort != null ? softForShort.hashCode() : 0);
		result = 31 * result
				+ (softFullName != null ? softFullName.hashCode() : 0);
		result = 31
				* result
				+ (softFunctionAndSpecialty != null ? softFunctionAndSpecialty
						.hashCode() : 0);
		result = 31 * result + (softNumber != null ? softNumber.hashCode() : 0);
		result = 31 * result
				+ (softwareEnv != null ? softwareEnv.hashCode() : 0);
		result = 31
				* result
				+ (sourceCodeCapacity != null ? sourceCodeCapacity.hashCode()
						: 0);
		result = 31 * result + (sqraddress != null ? sqraddress.hashCode() : 0);
		result = 31 * result
				+ (sqrcontactPerson != null ? sqrcontactPerson.hashCode() : 0);
		result = 31 * result + (sqremail != null ? sqremail.hashCode() : 0);
		result = 31 * result + (sqrfax != null ? sqrfax.hashCode() : 0);
		result = 31 * result + (sqrmobile != null ? sqrmobile.hashCode() : 0);
		result = 31 * result + (sqrname != null ? sqrname.hashCode() : 0);
		result = 31 * result + (sqrphone != null ? sqrphone.hashCode() : 0);
		result = 31 * result
				+ (sqrpostCode != null ? sqrpostCode.hashCode() : 0);
		result = 31 * result + (state != null ? state.hashCode() : 0);
		result = 31 * result + (agentDesc != null ? agentDesc.hashCode() : 0);
		result = 31 * result
				+ (appearAreaCity != null ? appearAreaCity.hashCode() : 0);
		result = 31
				* result
				+ (appearAreaCountry != null ? appearAreaCountry.hashCode() : 0);
		result = 31 * result + (appearDate != null ? appearDate.hashCode() : 0);
		result = 31 * result + (applyType != null ? applyType.hashCode() : 0);
		result = 31 * result
				+ (belongType0 != null ? belongType0.hashCode() : 0);
		// result = 31 * result + (busType1 != null ? busType1.hashCode() : 0);
		// result = 31 * result + (city1 != null ? city1.hashCode() : 0);
		result = 31 * result
				+ (completeDate != null ? completeDate.hashCode() : 0);
		result = 31 * result + (dailr != null ? dailr.hashCode() : 0);
		result = 31 * result
				+ (developCircs != null ? developCircs.hashCode() : 0);
		result = 31 * result
				+ (developMode != null ? developMode.hashCode() : 0);
		result = 31 * result
				+ (difmatKeepPages != null ? difmatKeepPages.hashCode() : 0);
		// result = 31 * result + (country1 != null ? country1.hashCode() : 0);
		result = 31 * result + (applyTime != null ? applyTime.hashCode() : 0);
		result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);

		return result;
	}

	public String toString() {
		StringBuffer sb = new StringBuffer(getClass().getSimpleName());

		sb.append(" [");
		sb.append("id").append("='").append(getId()).append("', ");
		sb.append("difmatReferMode").append("='").append(getDifmatReferMode())
				.append("', ");
		sb.append("dlraddress").append("='").append(getDlraddress())
				.append("', ");
		sb.append("dlrcontactPerson").append("='")
				.append(getDlrcontactPerson()).append("', ");
		sb.append("dlremail").append("='").append(getDlremail()).append("', ");
		sb.append("dlrfax").append("='").append(getDlrfax()).append("', ");
		sb.append("dlrmobile").append("='").append(getDlrmobile())
				.append("', ");
		sb.append("dlrname").append("='").append(getDlrname()).append("', ");
		sb.append("dlrphone").append("='").append(getDlrphone()).append("', ");
		sb.append("dlrpostCode").append("='").append(getDlrpostCode())
				.append("', ");
		sb.append("editionNumber").append("='").append(getEditionNumber())
				.append("', ");
		// sb.append("garden1").append("='").append(getGarden1()).append("', ");
		sb.append("hardwareEnv").append("='").append(getHardwareEnv())
				.append("', ");
		sb.append("hasLetter1").append("='").append(getHasLetter1())
				.append("', ");
		// sb.append("idNumber1").append("='").append(getIdNumber1()).append("', ");
		// sb.append("idTypes1").append("='").append(getIdTypes1()).append("', ");
		sb.append("isMutilDoc").append("='").append(getIsMutilDoc())
				.append("', ");
		sb.append("kind").append("='").append(getKind()).append("', ");
		sb.append("loginId").append("='").append(getLoginId()).append("', ");
		sb.append("mutilDocType").append("='").append(getMutilDocType())
				.append("', ");
		// sb.append("name1").append("='").append(getName1()).append("', ");
		sb.append("origRegisterNumber").append("='")
				.append(getOrigRegisterNumber()).append("', ");
		sb.append("origSoftModifyDescription").append("='")
				.append(getOrigSoftModifyDescription()).append("', ");
		// sb.append("peopleType1").append("='").append(getPeopleType1()).append("', ");
		sb.append("programLanguage").append("='").append(getProgramLanguage())
				.append("', ");
		sb.append("proveFile").append("='").append(getProveFile())
				.append("', ");
		// sb.append("province1").append("='").append(getProvince1()).append("', ");
		sb.append("publishStatus").append("='").append(getPublishStatus())
				.append("', ");
		sb.append("rightObtainMode").append("='").append(getRightObtainMode())
				.append("', ");
		sb.append("rightScope").append("='").append(getRightScope())
				.append("', ");
		sb.append("rightScopePart").append("='").append(getRightScopePart())
				.append("', ");
		sb.append("shenqr").append("='").append(getShenqr()).append("', ");
		sb.append("softForShort").append("='").append(getSoftForShort())
				.append("', ");
		sb.append("softFullName").append("='").append(getSoftFullName())
				.append("', ");
		sb.append("softFunctionAndSpecialty").append("='")
				.append(getSoftFunctionAndSpecialty()).append("', ");
		sb.append("softNumber").append("='").append(getSoftNumber())
				.append("', ");
		sb.append("softwareEnv").append("='").append(getSoftwareEnv())
				.append("', ");
		sb.append("sourceCodeCapacity").append("='")
				.append(getSourceCodeCapacity()).append("', ");
		sb.append("sqraddress").append("='").append(getSqraddress())
				.append("', ");
		sb.append("sqrcontactPerson").append("='")
				.append(getSqrcontactPerson()).append("', ");
		sb.append("sqremail").append("='").append(getSqremail()).append("', ");
		sb.append("sqrfax").append("='").append(getSqrfax()).append("', ");
		sb.append("sqrmobile").append("='").append(getSqrmobile())
				.append("', ");
		sb.append("sqrname").append("='").append(getSqrname()).append("', ");
		sb.append("sqrphone").append("='").append(getSqrphone()).append("', ");
		sb.append("sqrpostCode").append("='").append(getSqrpostCode())
				.append("', ");
		sb.append("state").append("='").append(getState()).append("', ");
		sb.append("agentDesc").append("='").append(getAgentDesc())
				.append("', ");
		sb.append("appearAreaCity").append("='").append(getAppearAreaCity())
				.append("', ");
		sb.append("appearAreaCountry").append("='")
				.append(getAppearAreaCountry()).append("', ");
		sb.append("appearDate").append("='").append(getAppearDate())
				.append("', ");
		sb.append("applyType").append("='").append(getApplyType())
				.append("', ");
		sb.append("belongType0").append("='").append(getBelongType0())
				.append("', ");
		// sb.append("busType1").append("='").append(getBusType1()).append("', ");
		// sb.append("city1").append("='").append(getCity1()).append("', ");
		sb.append("completeDate").append("='").append(getCompleteDate())
				.append("', ");
		sb.append("dailr").append("='").append(getDailr()).append("', ");
		sb.append("developCircs").append("='").append(getDevelopCircs())
				.append("', ");
		sb.append("developMode").append("='").append(getDevelopMode())
				.append("', ");
		sb.append("difmatKeepPages").append("='").append(getDifmatKeepPages())
				.append("', ");
		// sb.append("country1").append("='").append(getCountry1()).append("', ");
		sb.append("applyTime").append("='").append(getApplyTime())
				.append("', ");
		sb.append("updateTime").append("='").append(getUpdateTime())
				.append("', ");
		sb.append("]");

		return sb.toString();
	}

}
